package com.mva.common;

public abstract class StringUtils
  {
   public static String padWithSpaces (String s, int length)
	 {
	  if (s.length() < length)
		{
		 StringBuilder sb = new StringBuilder(s);
		 while(sb.length() < length)
		   {
			  sb.append(" ");
		   }
		 return sb.toString();
		}
	  else
		{
		 return s.substring(0, length);
		}
	 }
   
   public static String intToString (int i)
     {
	    return Integer.toString(i);
     }
     
   public static String getString (Scanner sc, String prompt)
     {
      System.out.print(prompt);
      String s = sc.next();        // Read the first string on the line
      sc.nextLine();               // Discard any other data entered on the line
      return s;
     }
  }